#!/bin/sh
CONTAINER="search-service"
IMAGE=$CONTAINER":"$(date -d "today" +"%Y%m%d_%H%M%S")
docker rm -f `docker ps -a | grep -w $CONTAINER  | awk '{print $1}'` 
docker rmi --force `docker images | grep -w $CONTAINER | awk '{print $3}'`
docker build -t $IMAGE .
docker save -o $CONTAINER.tar $IMAGE
#docker run --name=$CONTAINER -p 8095:8095 -d $IMAGE
